package com.pro.controller;

import com.pro.pojo.JsNumber;
import com.pro.pojo.JsonData;
import com.pro.service.UserStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName:UserStatisticsController
 * Package:com.pro.controller
 * Description:
 *
 * @Date:2022/2/7 12:58
 * @Author: XJR
 */
@RequestMapping("/userStatistics")
@RestController
public class UserStatisticsController {
    @Autowired
    private UserStatisticsService service;

    //计算前端总人数和后端总人数
    @RequestMapping("/selectBeforeAndUserCount")
    public JsonData selectBeforeAndUserCount(){
        JsNumber number = service.selectBeforeAndUserCount();
        return number!=null?JsonData.buildSuccess(number):JsonData.buildError("服务器发生错误");
    };
}
